import Vue from 'vue'
import VueRouter from 'vue-router'
import ShouYe from '@/views/ShouYe.vue'
import ZhaoFang from '@/views/ZhaoFang.vue'
import ZiXun from '@/views/ZiXun.vue'
import User from '@/views/User.vue'
import Layout from '@/views/Layout.vue'
import CityList from '@/views/CityList.vue'
import Map from '@/views/map.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Layout,
    redirect: '/shouye',
    children: [
      { path: '/shouye', component: ShouYe },
      { path: '/zhaofang', component: ZhaoFang },
      { path: '/zixun', component: ZiXun },
      { path: '/user', component: User }
    ]
  },
  { path: '/citylist', component: CityList },
  { path: '/map', component: Map }
]

const router = new VueRouter({
  routes
})

export default router
